<html>
  <head>
    <title>
    </title>
	<link rel="stylesheet" href="../css/stylesheet.css" type="text/css" />
	<script src="http://code.jquery.com/jquery-latest.js"></script>
        <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
        <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
        <script>
  $(document).ready(function() {
    $("#kopf1").click(function () {
      $("#series").toggle('drop', { direction: 'left' }, 500);
    });
  });
  </script>
  </head>
  <body>
    <div id="kopf">
	<div id="kopf1">
		hallo Mitte
		<div id="login">
			rechts login
		</div>
		<div id="logo">
			Logo
		</div>
	</div>
	<div id="pfad">
            <p><a href="../">Index</a> > Series</p>
	</div>
</div>
    <div id="series">
<?php
require_once '../conf/DbConnector.php';

$db=mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME)
		or die('<p><font color=red>Fehler bei der Datenbankverbindung: '.
		mysqli_connect_errno().': '.mysqli_connect_error().'</p>');	

//$sql="SELECT Series.Ser_ID, Series.Ser_Name, Author.Auth_ID, Author.Auth_Name 
//FROM Series, Author, Book, Book_has_Lang 
//WHERE Series.Author_Auth_ID = Author.Auth_ID 
//AND Series.Ser_ID = Book.Series_Ser_ID 
//AND Book.Book_ID = Book_has_Lang.Book_Book_ID 
//AND Book_has_Lang.Lang_Lang_ID = 1 
//GROUP BY Series.Ser_ID
//ORDER BY Series.Ser_Name";

$sql="SELECT Series.Ser_ID, Series.Ser_Name, Author.Auth_ID, Author.Auth_Name 
FROM Series, Author, Book, LNDL
WHERE Series.Author_Auth_ID = Author.Auth_ID 
AND Series.Ser_ID = Book.Series_Ser_ID 
AND Book.Book_ID = LNDL.Book_Book_ID
GROUP BY Series.Ser_ID
ORDER BY Series.Ser_Name";

$result = mysqli_query($db, $sql);

    
while ($zeile=mysqli_fetch_array($result)){


?>
        <div id="content">
            <div class="ENAME" onClick="self.location.href='Series.php?id=<?php echo $zeile['Ser_ID']; ?>'">	 <div class="SNAME"><?php echo $zeile['Ser_Name']; ?></div>  <div class="ANAME"><?php echo $zeile['Auth_Name']; ?>	</div>	</div>
        </div>
<?php

}

mysqli_close($db);
?>
  </div>
  </body>
</html>